﻿@{
    BankPartner bp = new BankPartner();
    bp.Name = UtilityManager.GetVal(Request["bname"]);
    bp.Code = UtilityManager.GetVal(Request["bcode"]);
    bp.Active = Convert.ToInt32(Request["active"]);
    var query = BankPartnerManager.SearchBP(bp);
      
      var cols = new []{"Code","Name","Active","CardPrefix","AuthContactPerson","AuthEmail"};
      var grid = new WebGrid(query,canSort:false,canPage:true,rowsPerPage:5,columnNames:cols,ajaxUpdateContainerId: "grid2");
       
}
<style>
    .fg-button{
        outline:0;
        marin:0 4 0 0;
        /*padding: .4em 1em;*/
        text-decoration:none !important;
        cursor:pointer;
        position:relative;
        text-align:center;
        zoom:1;
        width:100px;
        height:25px;
       
    }
    
</style>
<script>
    $(function(){
        
        $("#addCustomer").click(function(){
            $("#custSearchForm").attr("action","@Href("~/Customer/Index/main")");
            $("#custSearchForm").submit();
        });
        
        $('th a, tfoot a').live('click', function(){
            $(this).attr('href', '#grid-anchor');
        });
    });
</script>
<fieldset>
        <legend>Search Results</legend>
         <a name="grid-anchor"></a>   
        <div id="grid2">
            @functions{
             
                static IHtmlString ShowActive(string active){
                    return active=="0"?new HtmlString("No"):new HtmlString("Yes");
                }
                
           }
            @grid.GetHtml(
               tableStyle:"webgrid",
               alternatingRowStyle:"webgrid-alternating-row",
               headerStyle:"ui-widget-header",
               fillEmptyRows:true,
               columns:grid.Columns(
                      
                      grid.Column(
                      header:"",
                      format:@<a href="/Maintenance/Index/editbp/@item.ID">Edit</a>),
                     
                    grid.Column(
                        columnName:"Code",
                        header:"Bank Code"
                      ),
                      grid.Column(
                         columnName:"Name",
                         header:"Bank Name"
                      ),
                     grid.Column(
                         columnName:"Active",
                         header:"Active",
                         format:@<text>@ShowActive(item.Active.ToString())</text>
                      ),
                    grid.Column(
                         columnName:"CardPrefix",
                         header:"Card Prefix"
                      ),
                    
                      grid.Column(
                         columnName:"AuthContactPerson",
                         header:"Contact Person"
                      ),
                    
                      grid.Column(
                         columnName:"AuthEmail",
                         header:"Email"
                      )
                      
               
              )
               
            )
        </div>
           </fieldset>
       <!--<div id="buttons" >
        <p>
        <input class="fg-button ui-state-default ui-corner-all" type="button" name="addCustomer" id="addCustomer" value="Add Customer"/>    
        </p>
        
    </div>-->
    